<template>
	<view>
		<button @click="goRsd()">刷新</button>
				<view v-for="index in count" :key="index">
					<view style="height:100rpx;background-color:aquamarine;margin: 5rpx;">
			测试数据{{index}}
			</view>
		</view>
		<view style="height: 100rpx;text-align: center;">-----真的没了-----</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				count:30
			}
		},
		onPullDownRefresh() {
			console.log("onPullDownRefresh 开始刷新");
			setTimeout(()=>{
				console.log("onPullDownRefresh 数据刷新完了");
				uni.stopPullDownRefresh()
			},2000)
		},
		onReachBottom() {
			//数据再次加载
			console.log("onReachBottom");
			if(this.count<200)
			this.count = this.count + 30;
		},
		methods: {
			goRsd(){
				uni.startPullDownRefresh({
					success() {
						console.log("startPullDownRefresh success");
					},
					fail() {
						console.log("startPullDownRefresh fail");
					},
					complete() {
						console.log("startPullDownRefresh complete");
					}
				})
			}
		}
	}
</script>

<style>

</style>
